#ifndef WOLF_FONT_TEST_HPP
#define WOLF_FONT_TEST_HPP

#include "font.hpp"
#include "StdFont.hpp"
#include "Manager.hpp"
#include "StdTest.hpp"

namespace wolf
{
    class FontTest : public StdTest
    {
    public:
        class MyEventHandler: public Manager
        {
        public:
            MyEventHandler( Font &font ): _font( font ) {}
            void onDraw( Engine &engine, SDL_Surface *dst )
            {
                _font.writeChar( '!', engine.getScreen(), 0, 0, ( SDL_Color )
                {
                    224, 224, 224, 255
                } );
                _font.writeText( "Hi mundo!\n:P", engine.getScreen(), 10, 0, ( SDL_Color )
                {
                    224, 224, 224, 255
                } );
            }
        private:
            Font &_font;
        };

        FontTest(): StdTest( "Font" ) {}
        ~FontTest() {}

        bool run( Engine &engine )
        {
            StdFont font;
            MyEventHandler eventHandler( font );
            engine.addManager( eventHandler );
            while( engine.isRunning() )
            {
                engine.doFrame();
            }
            return true;
        }
    };

}

#endif // WOLF_FONT_TEST_HPP

